package com.wellview.template.view;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;


import com.wellview.template.BaseActivity;
import com.wellview.template.Constant;
import com.wellview.template.R;

import java.io.Serializable;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/9/1 0001.
 */

public class ChooseActivity extends BaseActivity {
    @BindView(R.id.ll_alipay)
    LinearLayout llAlipay;
    @BindView(R.id.ll_wechat_pay)
    LinearLayout llWechatPay;

    @Override
    protected void beforeShow(Bundle savedInstanceState) {
        Serializable data = getIntent().getSerializableExtra("data");
    }

    @Override
    public void bindView() {
        setContentView(R.layout.activity_choose_pay_method);
    }

    @Override
    public void findAllViews() {

    }

    @Override
    public void setAllListeners() {

    }

    @Override
    public void doProcess() {

    }



    @OnClick({R.id.ll_alipay, R.id.ll_wechat_pay})
    public void onViewClicked(View view) {
        Intent intent = new Intent();

        switch (view.getId()) {
            case R.id.ll_alipay:
                intent.putExtra(Constant.METHOD_NAME,"alipay");
                intent.putExtra("data",getIntent().getSerializableExtra("data"));
                setResult(Constant.MESSAGE_CHOOSE_METHOD,intent);
                finish();
                break;
            case R.id.ll_wechat_pay:
                intent.putExtra(Constant.METHOD_NAME,"wechat");
                intent.putExtra("data",getIntent().getSerializableExtra("data"));
                setResult(Constant.MESSAGE_CHOOSE_METHOD,intent);
                finish();
                break;
        }
    }
}
